#pragma once
#include "vocoder.h"

/*
Utility class for overlapping Carrier samples.
Must be used in conjunction with a Carrier implementation that actually creates an appropriate signal.
*/
class OverlappingCarrier :
	public Carrier
{
public:
	OverlappingCarrier(Carrier* carrier, unsigned int overlapLength);
	~OverlappingCarrier(void);

	void SetFrequencyProvider(FrequencyProvider* frequencyProvider){}
	void SetVocoderListener(VocoderListener* vocoderListener);
	short* CreateCarrierSample(Settings* settings, short* modulatorSample, unsigned int length, std::vector<SampleMarker>* markers);

private:
	void Initialize(unsigned int windowLength);
	std::vector<short> lastSample;
	std::vector<short> curSample;
	Carrier* carrier;
	unsigned int overlapLength;
	VocoderListener* vocoderListener;
};
